// JavaScript Document
var xmlHttp

function submitIt(strArea)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
  		return;
  	} 
	var url="input.php";
	var str="";
	str=str+"<name>"+strArea+"</name>";
	alert("strArea is " + strArea);
	//url=url+"?p="+strArea;
	xmlDoc = new xmlDocument(str);

	xmlHttp.onreadystatechange = stateChanged; 
	xmlHttp.open("POST",url,true)
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp.setRequestHeader("Content-Length",str.length);
	xmlHttp.send(xmlDoc);
	alert(xmlDoc);
}

function createPriya()
{
	xmlHttp=GetXmlHttpObject();
	var url="input.php";
	var text="<name>";
	text=text+"MyName";
	text=text+"</name>";
	
// code for IE
if (window.ActiveXObject)
  {
  var doc=new ActiveXObject("Microsoft.XMLDOM");
  doc.async="false";
  doc.loadXML(text);
  }
// code for Mozilla, Firefox, Opera, etc.
else
  {
  var parser=new DOMParser();
  var doc=parser.parseFromString(text,"text/xml");
  }

// documentElement always represents the root node
var x=doc.documentElement;

	xmlHttp.onreadystatechange = stateChanged; 
	xmlHttp.open("POST",url,true);
//	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	//xmlHttp.setRequestHeader("Content-Length",str.length);
	xmlHttp.send(text);
	//xmlHttp.send(doc);
//document.write("Text of first child element: ");
//document.write(x.childNodes[0].nodeValue);
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 ||xmlHttp.readyState=="complete")
	{ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
  	{
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	}
	catch (e)
  	{
  		// Internet Explorer
  		try
    	{
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}
  		catch (e)
    	{
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}
  	}
	return xmlHttp;
}